package spm.entities;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * This is a persistent class used by Hibernate. The class represents a task in
 * the project.
 * 
 * @author Evgeny Ryzhkov
 * 
 * $Id: Task.java 11 2006-12-04 15:04:58Z evgeny.ryzhkov $
 */
public class Task {

	/**
	 * The unique ID of the task.
	 */
	private Long id;

	/**
	 * The task short name.
	 */
	private String taskName;

	/**
	 * The task description.
	 */
	private String taskDescription;

	/**
	 * The date the task was created.
	 */
	private Date createDate;

	/**
	 * The planned start date.
	 */
	private Date plannedStartDate;

	/**
	 * The actual start date. The value of the field should be calculated
	 * automatically based on TaskLog records.
	 */
	private Date actualStartDate;

	/**
	 * The estimated finish date.
	 */
	private Date estimatedFinishDate;

	/**
	 * The actual finish date. The value of the field should be calculated
	 * automatically based on TaskLog records.
	 */
	private Date actualFinishDate;

	/**
	 * The esimated number of hours for the task to be completed.
	 */
	private int estimatedHours;

	/**
	 * The actual number of hours spent for the task. The value of the field
	 * should be calculated automatically based on TaskLog records.
	 */
	private int actualHours;

	/**
	 * THe task status.
	 */
	private TaskStatus taskStatus;

	/**
	 * The task priority.
	 */
	private TaskPriority taskPriority;

	/**
	 * The task logs connected with the task.
	 */
	private Set taskLogs = new HashSet();

	/**
	 * The users are assigned to the task.
	 */
	private Set assignedUsers = new HashSet();

	/**
	 * Constructor without parameters. It is required by Hibernate.
	 */
	public Task() {
	}

	/**
	 * @return Returns the actualFiniahDate.
	 */
	public Date getActualFinishDate() {
		return actualFinishDate;
	}

	/**
	 * @param actualFiniahDate
	 *            The actualFiniahDate to set.
	 */
	public void setActualFiniahDate(Date actualFinishDate) {
		this.actualFinishDate = actualFinishDate;
	}

	/**
	 * @return Returns the actualHours.
	 */
	public int getActualHours() {
		return actualHours;
	}

	/**
	 * @param actualHours
	 *            The actualHours to set.
	 */
	public void setActualHours(int actualHours) {
		this.actualHours = actualHours;
	}

	/**
	 * @return Returns the actualStartDate.
	 */
	public Date getActualStartDate() {
		return actualStartDate;
	}

	/**
	 * @param actualStartDate
	 *            The actualStartDate to set.
	 */
	public void setActualStartDate(Date actualStartDate) {
		this.actualStartDate = actualStartDate;
	}

	/**
	 * @return Returns the createDate.
	 */
	public Date getCreateDate() {
		return createDate;
	}

	/**
	 * @param createDate
	 *            The createDate to set.
	 */
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	/**
	 * @return Returns the estimatedFinishDate.
	 */
	public Date getEstimatedFinishDate() {
		return estimatedFinishDate;
	}

	/**
	 * @param estimatedFinishDate
	 *            The estimatedFinishDate to set.
	 */
	public void setEstimatedFinishDate(Date estimatedFinishDate) {
		this.estimatedFinishDate = estimatedFinishDate;
	}

	/**
	 * @return Returns the estimatedHours.
	 */
	public int getEstimatedHours() {
		return estimatedHours;
	}

	/**
	 * @param estimatedHours
	 *            The estimatedHours to set.
	 */
	public void setEstimatedHours(int estimatedHours) {
		this.estimatedHours = estimatedHours;
	}

	/**
	 * @return Returns the id.
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            The id to set.
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return Returns the plannedStartDate.
	 */
	public Date getPlannedStartDate() {
		return plannedStartDate;
	}

	/**
	 * @param plannedStartDate
	 *            The plannedStartDate to set.
	 */
	public void setPlannedStartDate(Date plannedStartDate) {
		this.plannedStartDate = plannedStartDate;
	}

	/**
	 * @return Returns the taskDescription.
	 */
	public String getTaskDescription() {
		return taskDescription;
	}

	/**
	 * @param taskDescription
	 *            The taskDescription to set.
	 */
	public void setTaskDescription(String taskDescription) {
		this.taskDescription = taskDescription;
	}

	/**
	 * @return Returns the taskName.
	 */
	public String getTaskName() {
		return taskName;
	}

	/**
	 * @param taskName
	 *            The taskName to set.
	 */
	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}

	/**
	 * @return the taskPriority
	 */
	public TaskPriority getTaskPriority() {
		return taskPriority;
	}

	/**
	 * @param taskPriority
	 *            the taskPriority to set
	 */
	public void setTaskPriority(TaskPriority taskPriority) {
		this.taskPriority = taskPriority;
	}

	/**
	 * @return the taskStatus
	 */
	public TaskStatus getTaskStatus() {
		return taskStatus;
	}

	/**
	 * @param taskStatus
	 *            the taskStatus to set
	 */
	public void setTaskStatus(TaskStatus taskStatus) {
		this.taskStatus = taskStatus;
	}

	/**
	 * @return the taskLogs
	 */
	public Set getTaskLogs() {
		return taskLogs;
	}

	/**
	 * @param taskLogs
	 *            the taskLogs to set
	 */
	public void setTaskLogs(Set taskLogs) {
		this.taskLogs = taskLogs;
	}

	/**
	 * @return the assignedUsers
	 */
	public Set getAssignedUsers() {
		return assignedUsers;
	}

	/**
	 * @param assignedUsers
	 *            the assignedUsers to set
	 */
	public void setAssignedUsers(Set assignedUsers) {
		this.assignedUsers = assignedUsers;
	}

}
